ποΈGitΠ―ΡΠ°ποΈ
feature/car/TESTING.md fix/fdroid-map-rendering (113121c4) Text, 2.82 KB
Tc9d1d9# Testing the Car (Android Auto) feature
Two ways to verify Ta5d6ff`feature:car`. Use the unit tests for correctness; use the DHU only when you
want to eyeball the real in-car experience end to end.
Tc9d1d9## 1. Automated β `SessionController` tests (no hardware, runs in CI)
Ta5d6ff```Ta5d6ffbash
./gradlew :feature:car:testGoogleDebugUnitTest
Ta5d6ff```
Ta5d6ff`CarScreensTest` drives the real Ta5d6ff`HomeScreen` through the androidx.car.app testing context, pushing
state via the Ta5d6ff`CarStateCoordinator` test seam (Ta5d6ff`setStateForTest`), and asserts the right template
renders per connection state plus the Ta5d6ff`ALERT_APP` β emergency flow. This is what catches regressions
(e.g. it caught the Ta5d6ff`TabTemplate.setActiveTabContentId` crash the 1.7.0 pin introduced). Robolectric
is pinned to Ta5d6ff`@Config(sdk = [36])` because no Robolectric SDK-37 sandbox exists yet β harmless, the
templates are SDK-agnostic.
Tc9d1d9## 2. Visual β Desktop Head Unit (DHU)
Tc9d1d9### Platform matters
DHU decodes an H.264 video stream from the phone. **macOS Apple Silicon (Ta5d6ff`2.1-mac-arm64`) fails at
this step** β it connects and reports Ta5d6ff`Has video focus: true` but renders no frames. Use an
**x86_64 Linux (or Windows) host**; Ta5d6ff`linux-arm64` DHU does not exist, and an emulated x86 VM has no
hardware decode (same failure). A VM is fine **only on an x86_64 host with real virtualization**.
Tc9d1d9### Phone prep (one time)
Tff7b721. Settings β About β tap *Build number* Γ7 β enable **USB debugging** and **Wireless debugging**.
Tff7b722. Open Android Auto settings (on a Pixel: Ta5d6ff`adb shell am start -n com.google.android.projection.gearhead/.companion.settings.DefaultSettingsActivity`),
tap *Version* ~10Γ to unlock **Developer settings**, then enable **Start head unit server**.
Tc9d1d9### On the x86_64 box
Ta5d6ff```Ta5d6ffbash
sdkmanager Ta5d6ff"extras;google;auto" T8b949e# installs the linux-x86_64 DHU
T8b949e# Connect to the phone over wifi (no re-plugging; works even if the phone lives on another machine):
adb pair <phone-ip>:<pair-port> T8b949e# one-time; code shown under Wireless debugging
adb connect <phone-ip>:<debug-port>
adb forward tcp:5277 tcp:5277
Tffa657cd Ta5d6ff"Te6edf3$ANDROID_SDK_ROOTTa5d6ff/extras/google/autoTa5d6ff" Tff7b72&& ./desktop-head-unit
Ta5d6ff```
DHU commands: type Ta5d6ff`help` in its shell; Ta5d6ff`focus video`, Ta5d6ff`tap <x> <y>`, Ta5d6ff`screenshot <file>`.
Tc9d1d9### Caveat: our app has no car-launcher tile
Ta5d6ff`feature:car` is a **MESSAGING**-category app. It does not appear as an icon on the Android Auto
home β it surfaces when a **message notification** arrives. To see the Ta5d6ff`ConversationItem` UI in the
DHU you must have a **paired Meshtastic radio sending a text**; the notification (read-aloud + reply)
is the entry point. Without a radio you'll see the AA home, not our screens. (For the same reason,
the AAOS emulator is not a fit either: messaging isn't an AAOS distribution category, and the app is
projection-only β no Ta5d6ff`CarAppActivity`.)
Served by rngit 1.5.2 - Generated in 0.05s